package com.fau.wmbj.server.flowable.pojo.node;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.flowable.bpmn.model.FlowElement;
import org.flowable.bpmn.model.ImplementationType;
import org.flowable.bpmn.model.ServiceTask;

import java.util.List;

/**
 * Java服务
 *
 * @author jiawei
 * @version 1.0
 * @datetime 2024/6/24 下午3:42
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class JavaServiceNode extends Node {

    @Override
    public List<FlowElement> convert() {
        // java服务
        ServiceTask serviceTask = new ServiceTask();
        serviceTask.setId(this.getId());
        serviceTask.setName(this.getName());
        serviceTask.setImplementationType(ImplementationType.IMPLEMENTATION_TYPE_CLASS);
        serviceTask.setImplementation("com.fau.wmbj.server.flowable.service.JavaService");
        return List.of(serviceTask);
    }
}
